//// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
//package com.linqingying.gitcode.pullrequest.ui.details.action
//
//import com.intellij.collaboration.messages.CollaborationToolsBundle
//import com.intellij.openapi.project.Project
//import kotlinx.coroutines.CoroutineScope
//import kotlinx.coroutines.launch
//import com.linqingying.gitcode.pullrequest.GCPRAction
//import com.linqingying.gitcode.pullrequest.GCPRStatisticsCollector
//import com.linqingying.gitcode.pullrequest.ui.details.model.GCPRReviewFlowViewModel
//import java.awt.event.ActionEvent
//import javax.swing.AbstractAction
//import javax.swing.JButton
//
//internal class GCPRReRequestReviewAction(scope: CoroutineScope,
//                                         private val project: Project,
//                                         private val reviewFlowVm: GCPRReviewFlowViewModel)
//  : AbstractAction(CollaborationToolsBundle.message("review.details.action.rerequest")) {
//
//  init {
//    scope.launch {
//      reviewFlowVm.isBusy.collect { isBusy ->
//        isEnabled = !isBusy && reviewFlowVm.userCanManageReview
//      }
//    }
//  }
//
//  override fun actionPerformed(event: ActionEvent) {
//    GCPRStatisticsCollector.logDetailsActionInvoked(project, GCPRAction.RE_REQUEST_REVIEW, event.source is JButton)
//    reviewFlowVm.reRequestReview()
//  }
//}
